package com.webapp.domain.entity;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;




@Entity
public class UserDetail extends BaseEntity{


	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private long id;//id 主键
	
	private User user;
	private int userType; //用户标记
	private int role;	//身份标记
	private String actualName;	//真实姓名
	private String sex;	//性别
	private String birth;	//出生年月
	private String idCard;	//身份证号码
	private String phone;	//电话号码
	private String nation;	// 民族
	private String orgCode;	//组织号码
	private String orgName;	//组织名称
	private String legalPerson;	//法人
	private String registration;	//注册地
	private String orgNature;	//组织性质
	private int isAuthenticate;	//是否实名认证
	private String area;
	private String address;	//地址
	private String companyName;	//公司名称
	private Area areaUser;
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	public long getId() {
		return this.id;
	}
	public void setId(long id) {
		this.id = id;
	}

	
	@OneToOne(cascade=CascadeType.ALL,fetch=FetchType.LAZY,targetEntity=Area.class)
	@JoinColumn(name="area_id",referencedColumnName="id",insertable=true,updatable=true)
	public Area getAreaUser() {
		return areaUser;
	}
	public void setAreaUser(Area areaUser) {
		this.areaUser = areaUser;
	}
	@OneToOne(cascade=CascadeType.ALL,fetch=FetchType.LAZY,targetEntity=User.class)
	@JoinColumn(name="user_id")//指定一个外键，也可以不指定。
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	public void setUserType(int userType) {
		this.userType = userType;
	}
	public int getUserType() {
		return userType;
	}
	public int getRole() {
		return role;
	}
	public void setRole(int role) {
		this.role = role;
	}
	public String getActualName() {
		return actualName;
	}
	public void setActualName(String actualName) {
		this.actualName = actualName;
	}
	public String getSex() {
		return sex;
	}
	public void setSex(String sex) {
		this.sex = sex;
	}
	public String getBirth() {
		return birth;
	}
	public void setBirth(String birth) {
		this.birth = birth;
	}
	public String getIdCard() {
		return idCard;
	}
	public void setIdCard(String idCard) {
		this.idCard = idCard;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public String getOrgCode() {
		return orgCode;
	}
	public void setOrgCode(String orgCode) {
		this.orgCode = orgCode;
	}
	public String getOrgName() {
		return orgName;
	}
	public void setOrgName(String orgName) {
		this.orgName = orgName;
	}
	public String getLegalPerson() {
		return legalPerson;
	}
	public void setLegalPerson(String legalPerson) {
		this.legalPerson = legalPerson;
	}
	public String getRegistration() {
		return registration;
	}
	public void setRegistration(String registration) {
		this.registration = registration;
	}
	public String getOrgNature() {
		return orgNature;
	}
	public void setOrgNature(String orgNature) {
		this.orgNature = orgNature;
	}
	public int getIsAuthenticate() {
		return isAuthenticate;
	}
	public void setIsAuthenticate(int isAuthenticate) {
		this.isAuthenticate = isAuthenticate;
	}
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	public String getCompanyName() {
		return companyName;
	}
	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}
	public String getArea() {
		return area;
	}
	public void setArea(String area) {
		this.area = area;
	}
	@Column(name = "nation", length = 20)
	public String getNation() {
		return nation;
	}
	public void setNation(String nation) {
		this.nation = nation;
	}
	
	
	
}
